﻿<ResourceDictionary
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
>

  <Style x:Key="ComboboxNullAsSeparatorStyle"
         TargetType="{x:Type ComboBoxItem}" >    <!-- BasedOn="{StaticResource {x:Type ComboBoxItem}}" -->
    <Style.Triggers>
      <DataTrigger Binding="{Binding}" Value="{x:Null}">
        <Setter Property="Template">
          <Setter.Value>
            <ControlTemplate TargetType="{x:Type ComboBoxItem}">
              <Separator HorizontalAlignment="Stretch" IsEnabled="False" />
            </ControlTemplate>
          </Setter.Value>
        </Setter>
      </DataTrigger>
    </Style.Triggers>
  </Style>

  <Style x:Key="ComboboxNullCancelButton" TargetType="{x:Type ComboBoxItem}" >
    <!-- BasedOn="{StaticResource {x:Type ComboBoxItem}}" -->
    <Style.Triggers>
      <DataTrigger Binding="{Binding}" Value="{x:Null}">
        <Setter Property="Template">
          <Setter.Value>
            <ControlTemplate TargetType="{x:Type ComboBoxItem}">
              <Button Content="Cancel"
                      Command="{Binding CancelCommand}"/>
            </ControlTemplate>
          </Setter.Value>
        </Setter>
      </DataTrigger>
    </Style.Triggers>
  </Style>

</ResourceDictionary>